CSharpTest.Net
SynchronizedDictionary<TKey,TValue> Constructor(IDictionary<TKey,TValue>,ILockStrategy)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > SynchronizedDictionary<TKey,TValue> Class > SynchronizedDictionary<TKey,TValue> Constructor : SynchronizedDictionary<TKey,TValue> Constructor(IDictionary<TKey,TValue>,ILockStrategy)

storage
locking

Glossary Item Box

Constructs a thread-safe generic collection of key/value pairs.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal storage As IDictionary(Of TKey,TValue), _
   ByVal locking As ILockStrategy _
)
C# 
public SynchronizedDictionary<TKey,TValue>( 
   IDictionary<TKey,TValue> storage,
   ILockStrategy locking
)

Parameters

storage
locking

Example

Library/Library.Test/TestSynchronizedCollections.cs

C#Copy Code
SynchronizedDictionary<string, string> test = new SynchronizedDictionary<string, string>(new Dictionary<string,string>(), new IgnoreLocking());
test["a"] = "b";
string all = String.Join("", new List<string>(test.Keys).ToArray());
Assert.AreEqual("a", all);
VB.NETCopy Code
Dim test As New SynchronizedDictionary(Of String, String)(New Dictionary(Of String, String)(), New IgnoreLocking())
test("a") = "b"
Dim all As String = [String].Join("", New List(Of String)(test.Keys).ToArray())
Assert.AreEqual("a", all)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys